#include<iostream>
#include<sstream>
#include<math.h>
#include<cstdlib>

using namespace std;
// '0' is ascii 48

int main(int argc, char * argv[]){
  //char zero='0';
  //cerr<<"debug:"<<(int)zero<<"!"<<endl;
  string line;
  while(getline(cin,line)){
    int den=0;
    int num=0;
    for(int i=0;i<line.length();++i){
      int g = (int)line[i] - 49;
      if (g>-1){
        num+=g;
        den+=2;
      }
    }
    float maf = 1.*num/den;
    float b1 = (1.-maf)*(1.-maf);
    float b2 = b1+2.*(maf)*(1.-maf);
    for(int i=0;i<line.length();++i){
      int g = (int)line[i] - 48;
      if (!g){
        float u = rand()/(1.+RAND_MAX);
        if (u<b1){
          g = 1;
        }else if (u<b2){
          g = 2;
        }else{
          g = 3;
        }
      }
      cout<<(g);
    }
    cout<<endl;
    
  }
  return 0;
}
